<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    let zhaoge = {
        name:"朝歌",
        age:22
    }
    let fengyu = {}

    let wl = (function () {


        /**
         * 不希望在访问wula的时候读取乌拉的数据
         * @type {{bf: {name: string, age: number}, name: string, age: number}}
         */
        let wula = {
            name:"乌拉",
            age:20,
            bf:zhaoge
        }


        let proxyWula = new Proxy(wula,{
            get(target, p, receiver) {
            },
            set(target, p, value, receiver) {
            }
        })

        return function ({type,opea,info}) {
            if(type==="get"){

                if(opea !== "age"){
                    return wula[opea] || ''
                }else {
                    if(info === zhaoge){
                        return wula["age"]
                    }else{
                        return "哼~人家才不要告诉你年龄呢"
                    }
                }
            }else if(type ==="set"){
                if(info ===zhaoge){
                    if(opea.id !== undefined){
                        wula.id = opea.id
                    }
                }else {
                    return "哼~人家的信息才不让你改呢"
                }
            }

            if(info ===zhaoge){

            }
        }

    })();

    console.log(wl({
        type: 'get',
        opea: "name",
        info: fengyu
    }));


    // new Proxy(target,handle)
</script>

</body>
</html>